import {
  post,
  get2
} from '../http/axios.js'
import {
  baseUrl,
  ssrBaseUrl
} from '../constant/index'
const base = {
  baseUrl,
  ssrBaseUrl
}
// 获取背景图片
export const getHomeBackgroundConfigInfo = (data) => get2(`${base.baseUrl}/api/home/getHomeBackgroundConfigInfo`, data)
export const getHomeBackgroundConfigInfoSsr = (data) => get2(`${base.ssrBaseUrl}/api/home/getHomeBackgroundConfigInfo`, data)

// 获取用户信息
export const userInfo = (data) => get2(`${base.baseUrl}/api/userInfo`, data)

// es企业查询
export const getCompany = (data) => post(`${base.baseUrl}/api/es/company/query.json`, data)
export const getCompanySsr = (data) => post(`${base.ssrBaseUrl}/api/es/company/query.json`, data)

// es政策查询
export const getPolicy = (data) => post(`${base.baseUrl}/api/es/Policy/queryPolicyList.json`, data)

// es项目查询
export const getProject = (data) => post(`${base.baseUrl}/api/es/project/query.json`, data)

// 获取查询类型关键字
export const getHomeDictConfigInfo = (data) => get2(`${base.baseUrl}/api/home/getHomeDictConfigInfo`, data)

// 热门搜索
export const getSearchKeywordsInfo = (type) => get2(`${base.baseUrl}/api/home/getSearchKeywordsInfo?type=${type}`)
export const getSearchKeywordsInfoSsr = (type) => get2(`${base.ssrBaseUrl}/api/home/getSearchKeywordsInfo?type=${type}`)
